import store from '@/store'

export const isSuperAdmin = (roles) => { // 是否有超级管理员权限
  return roles.indexOf('superAdmin') >= 0
}

// 是否包含商户内权限
export const isExistShopAuthoritys = (url) => {
  let ShopAuthoritys = store.getters.ShopAuthoritys
  let shopId = store.getters.currentShopID
  if (!ShopAuthoritys || ShopAuthoritys.length <= 0) {
    return false
  }
  return ShopAuthoritys.some(item => {
    return (`${item.ShopId}` === `${shopId}`) && (item.Url === url)
  })
}
